! File m:\scr\charges.scr v3.1 1996/02/16 15:10
!
! $Log: charges.scc $
! Revision 3.1  1997/02/16  18:00:00  Bob_Munson
! removed guide routines and bugfix
!
! Revision 3.0  1996/11/27  01:08:30  Bob_Munson
! modified to alow non english menu's to be bypassed
!
! Revision 2.0  1996/02/16  19:36:08  Mark_Hadfield
! 3USCRIPT release 2.0
!
! Revision 1.1  1995/10/03  21:04:48  Mark_Hadfield
! Initial revision
!

INFO "CHARGES $Revision: 3.1 $"
NEXISTS "m:\cis\switch\Charges.on" GOTO leave
EXISTS "\cis\service\Charges.cis"  GOTO leave

! -- turn off paging
SENDWAIT 120 "set page no", "!" GOTO noprompt

! -- Open Charges.Cis --
EXISTS "m:\cis\switch\Sleuth.on" GOTO closelog
EXISTS "m:\cis\switch\Log.on" GOTO closelog

opencharges:
CAPTURE "\cis\service\Charges.cis"

SENDWAIT 360 "GO CIS:BIL-647",  "!" GOTO noprompt ! -- 1 -- Account Balance 
CAPTURE OFF ! Don't wastlessly log menu's
SENDWAIT 120 "", "!" GOTO noprompt
CAPTURE "\cis\service\Charges.cis",APPEND
SENDWAIT 360 "2", "!" GOTO noprompt ! -- 2 -- Check Remaining Free Time
CAPTURE OFF ! Don't wastlessly log menu's
SENDWAIT 120 "", "!" GOTO noprompt
CAPTURE "\cis\service\Charges.cis",APPEND
SENDWAIT 360 "3", "!" GOTO noprompt ! -- 3 -- Account History 
CAPTURE OFF ! Don't wastlessly log menu's
SENDWAIT 120 "", "!" GOTO noprompt
SENDWAIT 360 "4", "!" GOTO noprompt ! -- 4 -- Detailed Session Activity 
CAPTURE "\cis\service\Charges.cis",APPEND
SENDWAIT 360 "1", "!" GOTO noprompt ! -- 1 -- This weeks Activity 
! change "1" to "1-4" for whole months activity instead of week.

CAPTURE OFF ! -- Close Charges.cis --

NEXISTS "m:\cis\switch\Log.on" GOTO nolog
CAPTURE "\cis\archive\Readcis.log",APPEND

nolog:
NEXISTS "m:\cis\switch\Sleuth.on" GOTO leave
CAPTURE OFF
CAPTURE "\Sleuth.cis",APPEND

leave:
! If browsing restore paging and goto TOP menu
NEXISTS "M:\CIS\SWITCH\browse.tmp" GOTO goodbye
SENDWAIT 120 "set page yes", "!" GOTO noprompt
SENDWAIT 120 "GO TOP", "!" GOTO noprompt

goodbye:
EXISTS "m:\cis\switch\user2.on" GOTO GOuser2
farewell:

logoff:
NEXISTS "a:\app\readcis\Logoff.sco" GOTO blogoff
 CALL   "a:\app\readcis\Logoff.sco"
 blogoff:
NEXISTS "b:\app\readcis\Logoff.sco" GOTO mlogoff
 CALL   "b:\app\readcis\Logoff.sco"
 mlogoff:
NEXISTS "m:\app\readcis\Logoff.sco" GOTO mylogoff
 CALL   "m:\app\readcis\Logoff.sco"
 mylogoff:

SENDWAIT 60 "off", "Connect" GOTO modemhangup

modemhangup:
SENDWAIT 20 "+++", "OK" GOTO disconnect
SENDWAIT 60 "ATH", "NO CARRIER" GOTO disconnect
WAIT 20

disconnect:
HANGUP
EXIT

!---- Below are self contained procs --------------------

closelog:
	CAPTURE OFF
	GOTO opencharges


GOuser2:
	NEXISTS "a:\sco\3user2.sco" GOTO natwo
	CALL "a:\sco\3user2.sco"
	natwo:
	NEXISTS "b:\sco\3user2.sco" GOTO nbtwo
	CALL "b:\sco\3user2.sco"
	nbtwo:
	EXISTS "m:\sco\3user2.sco" GOTO nmtwo
	CALL "m:\sco\3user2.sco"
	nmtwo:
	GOTO farewell


noprompt:
	BEEP 5,300
	INFO "Compuserve has not responded with a prompt"
	WAIT 20
	GOTO logoff

EXIT
